using UnityEngine;
using System.Collections;

public class AtlasJogo : MonoBehaviour 
{
    public static Texture2D globalTexture;
    public static Rect[] rects;
    private Texture2D[] textures;

    public static Material globalMaterial;

    void Awake()
    {
        textures = new Texture2D[9];

		this.textures[0] = ((Texture2D)Resources.Load("Textures/BG"));
        this.textures[1] = ((Texture2D)Resources.Load("Textures/Personagem-1"));
        this.textures[2] = ((Texture2D)Resources.Load("Textures/Personagem-2"));
        this.textures[3] = ((Texture2D)Resources.Load("Textures/Personagem-3"));
        this.textures[4] = ((Texture2D)Resources.Load("Textures/Personagem-4"));
        this.textures[5] = ((Texture2D)Resources.Load("Textures/1"));
        this.textures[6] = ((Texture2D)Resources.Load("Textures/2"));
        this.textures[7] = ((Texture2D)Resources.Load("Textures/3"));
        this.textures[8] = ((Texture2D)Resources.Load("Textures/4"));

        globalTexture = AtlasTexture.Create(this.textures, out rects);

        globalMaterial = new Material((Shader)Resources.Load("Shader/Basic2D"));
        globalMaterial.mainTexture = globalTexture;
    }
}
